package com.dc.refactoring._3_重新组织数据._1_SelfEncapsulateField.oldObject;

/**
 * Description: 自封装字段_整数范围
 * @author: gdc
 * @date: 2020/11/16
 * @version 1.0
 */
public class IntRange {
    /**
     * 低
     */
    private int low;
    /**
     * 高
     */
    private int high;

    public IntRange(int low, int high) {
        this.high = high;
        this.low = low;
    }

    public boolean includes(int arg) {
        // 当前直接操作字段值
        return arg >= low && arg <= high;
    }

    public void grow(int factor) {
        high = high * factor;
    }



    public int getLow() {
        return low;
    }

    public void setLow(int low) {
        this.low = low;
    }

    public int getHigh() {
        return high;
    }

    public void setHigh(int high) {
        this.high = high;
    }
}
